package com.ccc.boot.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ccc.boot.system.entity.RelUserRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* 用户角色中间表 Mapper 接口
*
* @author superC
* @date 2022-03-31
* @version 0.1.0
*/
@Repository
public interface RelUserRoleMapper extends BaseMapper<RelUserRole> {

    RelUserRole selectByKey(@Param("userId") Long userId,
                            @Param("roleId") Long roleId);

    List<Long> selectByRoleId(@Param("roleId") Long roleId);

    int insertBatch(@Param("roleId") Long roleId,
                    @Param("userIds") List<Long> userIds);

    int deleteByKey(@Param("userId") Long userId,
                    @Param("roleId") Long roleId);

}
